package cn.gene.timeyan.ums.webapi.ums.mapper;

import cn.gene.timeyan.pojo.ums.dto.UserBindDTO;
import cn.gene.timeyan.pojo.ums.model.Set;
import cn.gene.timeyan.pojo.ums.model.User;
import cn.gene.timeyan.pojo.ums.vo.UserVO;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p> 用户基本（常用）信息表 Mapper 接口</p>*
 *
 * @author LWG
 * @date 2022/7/23 11:18
 * @since 1.0.0@gene.cn
 */
@Repository
public interface UserMapper {
    User selectUser(Long id);
    User SuperSelectUser(Long id);
    Set isWatermark(Long id);
    int updatePasswordById(Long userId,String password);
    int updateHeader(Long userId, String imgURL);
    int collectMark(Long userId,String markLevel);

    int updateEmail(UserBindDTO userBindDTO);
    int updatePhone(UserBindDTO userBindDTO);
    String selectEmailByUserId(Long userId);
    String selectPhoneByUserId(Long userId);
    /**
     *添加用户  dj
     * @param user 添加用户
     * @return
     */
    @DS("master")
    int insert(User user);

    /**
     *查询用户  dj
     * @param Phone 查询用户
     * @return
     */
    @DS("master")
    User getByPhone(String Phone);

    /**
     *查询用户   dj
     * @param email 查询用户
     * @return
     */
    @DS("master")
    User getByEmail(String email);

    /**
     * 返回所有用户信息  lwg
     * @return
     */
    @DS("master")
    List<UserVO> list();
}
